# 设置最低 CMake 版本
cmake_minimum_required(VERSION 3.20)
# 定义项目名称
project(My_Project)
# 启用文件夹功能
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# 设置安装路径为项目目录下的 install 文件夹
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install CACHE PATH "Installation directory" FORCE)

# 设置 C++ 标准
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)

set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/$<CONFIG>)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/$<CONFIG>)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib/$<CONFIG>)

# 添加子目录
add_subdirectory(3rdparty)
add_subdirectory(src)
add_subdirectory(test) # 添加新的独立测试目录

# 启用测试
enable_testing()
